#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<sys/mman.h>
#include<unistd.h>

int color = 0xFFFF00;
int *p = NULL;

<<<<<<< HEAD
void setxy(int x,int y,int *p){
    for(int r = y; r <= y+8;r++){
		*(p+x+r*800) = color;
	}
}
=======
void jindu(){
>>>>>>> e6c45aa252cb41e02241094bf008e08e8a71cbde

    int lcd_fd = open("/dev/fb0",O_RDWR);
    if (-1 == lcd_fd)
    {
        perror("open() lcd failed\n");
        return -1;
    }
    else
    {
        printf("open() lcd success\n");
    }

    p = mmap(NULL,800*480*4, PROT_READ|PROT_WRITE, MAP_SHARED,lcd_fd,0);

    if (NULL == p)
    {
        perror("mmap() failed\n");
        return 0;
    }


    for (size_t i = 80; i < 200; i++)
<<<<<<< HEAD
	{
		for(int r = 380; r <= 400;r++){
		    *(p+i+r*800) = color;
	    }
	}
    sleep(1);
    for (size_t i = 200; i < 400; i++)
	{
		for(int r = 380; r <= 400;r++){
		    *(p+i+r*800) = color;
	    }
	}
    sleep(1);
    for (size_t i = 400; i < 700; i++)
=======
>>>>>>> c1d33a782353408bc6c33ff2d7943005ff5787c2
	{
		for(int r = 380; r <= 400;r++){
		    *(p+i+r*800) = color;
	    }
	}
<<<<<<< HEAD
    
    close(lcd_fd);
}

int main()
{	
	jindu();
	return 0;
=======
    sleep(1);
    for (size_t i = 200; i < 400; i++)
	{
		for(int r = 380; r <= 400;r++){
		    *(p+i+r*800) = color;
	    }
	}
    sleep(1);
    for (size_t i = 400; i < 700; i++)
	{
		for(int r = 380; r <= 400;r++){
		    *(p+i+r*800) = color;
	    }
	}
    
    close(lcd_fd);
>>>>>>> c1d33a782353408bc6c33ff2d7943005ff5787c2
}

int main()
{	
	jindu();
	return 0;
}
